package com.echo.code.spring.springbootdemo.profile;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

/**
 * Description
 *
 * @author baiyp
 * @version 1.0.0
 * @date 2019/04/28
 */
@Configuration
public class FruitConfig {

  @Bean
  @Profile("dev")
  public Fruit banana() {
    Fruit banana = Banana.builder().fruitName("banana").fruitWeight(2.00).build();
    return banana;
  }

  @Bean
  @Profile("test")
  public Fruit apple() {
    Fruit apple = Apple.builder().fruitName("apple").fruitColor("red").build();
    return apple;
  }

  @Bean
  @Profile("pro")
  public Fruit orange() {
    Fruit orange = Orange.builder().fruitName("orange").fruitSize("normal").build();
    return orange;
  }
}
